home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 100
/
FreelogNo100-NovembreDecembre2010.iso
/
ViePratique
/
Calendar Magic
/
setup.exe
/
{app}
/
ScreenCalc.shf
< prev
next >
Wrap
Text File
|
2007-01-06
|
1KB
|
64 lines
Degrees
' Screen Attributes Calculator
'
' Inputs
'
' HRes = horizontal resolution
' VRes = vertical resolution
' Diag = screen diagonal length
'
' Outputs
'
' NumPix = total number of pixels
' AspR = aspect ratio
' ScrW = screen width
' ScrH = screen height
' ScrArea = screen area
' PixPerInch = number of pixels per inch
'
' First Screen
'
HRes1 = 800
==> HRes1 = 800
VRes1 = 600
==> VRes1 = 600
Diag1 = 5
==> Diag1 = 5
NumPix1 = HRes1 * VRes1
==> NumPix1 = 480000
AspR1 = int(100 * HRes1 / VRes1 + 0.499) / 100
==> AspR1 = 1.33
Fac1 = sqrt(HRes1 ^ 2 + VRes1 ^ 2)
==> Fac1 = 1000
ScrW1 = HRes1 * Diag1 / Fac1
==> ScrW1 = 4
ScrH1 = VRes1 * Diag1 / Fac1
==> ScrH1 = 3
ScrArea1 = ScrW1 * ScrH1
==> ScrArea1 = 12
PixPerInch1 = int(HRes1 / ScrW1 + 0.499)
==> PixPerInch1 = 200
'
' Second Screen
'
HRes2 = 1280
==> HRes2 = 1280
VRes2 = 1024
==> VRes2 = 1024
Diag2 = 19
==> Diag2 = 19
NumPix2 = HRes2 * VRes2
==> NumPix2 = 1310720
AspR2 = int(100 * HRes2 / VRes2 + 0.499) / 100
==> AspR2 = 1.25
Fac2 = sqrt(HRes2 ^ 2 + VRes2 ^ 2)
==> Fac2 = 1639.1998047828
ScrW2 = HRes2 * Diag2 / Fac2
==> ScrW2 = 14.836507379418
ScrH2 = VRes2 * Diag2 / Fac2
==> ScrH2 = 11.869205903534
ScrArea2 = ScrW2 * ScrH2
==> ScrArea2 = 176.09756097561
PixPerInch2 = int(HRes2 / ScrW2 + 0.499)
==> PixPerInch2 = 86